## Replication code for Estimating Candidates’ Political Orientation in a Polarized Congress
## We use R for 3.2.4 GUI 1.67 Mavericks build (7152), running on Mac OS 10.12.1 

library(foreign) ## We use version: foreign_0.8-66
library(xtable)  ## We use version: xtable_1.8-2
library(oc)      ## We use version: oc_0.95
library(pscl)    ## We use version: pscl_1.4.9

# calculate optimal classification estimates
source("oc.R")

# table 4 
chamber <- "house"
time <- "contemporaneous"
source("RollCall_Analysis_PCP_APRE.R")

# table 5 
chamber <- "house"
time <- "prospective"
source("RollCall_Analysis_PCP_APRE.R")

# table 6
chamber <- "senate"
time <- "contemporaneous"
source("RollCall_Analysis_PCP_APRE.R")

# table 7 
chamber <- "senate"
time <- "prospective" 
source("RollCall_Analysis_PCP_APRE.R")


